package lab01;

/**
 * Created by lenovo on 2017/9/29.
 */
public class Test10 {
    public static void main(String args[]){
        char first = 'A'; // 开始的字符
        int num = 4;
        for (int i = 1; i <= num; i++) {//控制行数
            for (int j = 1; j <= num - i; j++) {
                System.out.print(' ');//控制行起始位置
            }
            System.out.print(first++);//输出字母序列
            System.out.print(' ');
            for (int j = i - 1; j >= 1; j--) {
                System.out.print(first++);
                System.out.print(' ');
            }
            System.out.println();
        }
        for (int i = num ; i >0; i--) {
            for(int j =1;j<=num-i;j++){
                System.out.print(' ');
            }
            System.out.print(first++);
            System.out.print(' ');
            for(int j=i-1;j>=1;j--){
                System.out.print(first++);
                System.out.print(' ');
            }
            System.out.println();
        }
    }
}


